\(\int x (a+b \sec (c+d \sqrt {x})) \, dx\) [33]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 16, antiderivative size = 220 \[ \int x \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\frac {a x^2}{2}-\frac {4 i b x^{3/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {6 i b x \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 i b x \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {12 i b \operatorname {PolyLog}\left (4,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {12 i b \operatorname {PolyLog}\left (4,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4} \]

[Out]

1/2*a*x^2-4*I*b*x^(3/2)*arctan(exp(I*(c+d*x^(1/2))))/d+6*I*b*x*polylog(2,-I*exp(I*(c+d*x^(1/2))))/d^2-6*I*b*x*
polylog(2,I*exp(I*(c+d*x^(1/2))))/d^2-12*I*b*polylog(4,-I*exp(I*(c+d*x^(1/2))))/d^4+12*I*b*polylog(4,I*exp(I*(
c+d*x^(1/2))))/d^4-12*b*polylog(3,-I*exp(I*(c+d*x^(1/2))))*x^(1/2)/d^3+12*b*polylog(3,I*exp(I*(c+d*x^(1/2))))*
x^(1/2)/d^3

Rubi [A] (verified)

Time = 0.23 (sec) , antiderivative size = 220, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.438, Rules used = {14, 4289, 4266, 2611, 6744, 2320, 6724} \[ \int x \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\frac {a x^2}{2}-\frac {4 i b x^{3/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {12 i b \operatorname {PolyLog}\left (4,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {12 i b \operatorname {PolyLog}\left (4,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {6 i b x \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 i b x \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2} \]

[In]

Int[x*(a + b*Sec[c + d*Sqrt[x]]),x]

[Out]

(a*x^2)/2 - ((4*I)*b*x^(3/2)*ArcTan[E^(I*(c + d*Sqrt[x]))])/d + ((6*I)*b*x*PolyLog[2, (-I)*E^(I*(c + d*Sqrt[x]
))])/d^2 - ((6*I)*b*x*PolyLog[2, I*E^(I*(c + d*Sqrt[x]))])/d^2 - (12*b*Sqrt[x]*PolyLog[3, (-I)*E^(I*(c + d*Sqr
t[x]))])/d^3 + (12*b*Sqrt[x]*PolyLog[3, I*E^(I*(c + d*Sqrt[x]))])/d^3 - ((12*I)*b*PolyLog[4, (-I)*E^(I*(c + d*
Sqrt[x]))])/d^4 + ((12*I)*b*PolyLog[4, I*E^(I*(c + d*Sqrt[x]))])/d^4

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2611

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(
f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Dist[g*(m/(b*c*n*Log[F])), Int[(f + g*
x)^(m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 4266

Int[csc[(e_.) + Pi*(k_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c + d*x)^m*(ArcTanh[E
^(I*k*Pi)*E^(I*(e + f*x))]/f), x] + (-Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Log[1 - E^(I*k*Pi)*E^(I*(e + f*x))],
 x], x] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Log[1 + E^(I*k*Pi)*E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e,
f}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 4289

Int[(x_)^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Sec[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rule 6744

Int[((e_.) + (f_.)*(x_))^(m_.)*PolyLog[n_, (d_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(p_.)], x_Symbol] :> Simp
[(e + f*x)^m*(PolyLog[n + 1, d*(F^(c*(a + b*x)))^p]/(b*c*p*Log[F])), x] - Dist[f*(m/(b*c*p*Log[F])), Int[(e +
f*x)^(m - 1)*PolyLog[n + 1, d*(F^(c*(a + b*x)))^p], x], x] /; FreeQ[{F, a, b, c, d, e, f, n, p}, x] && GtQ[m,
0]

Rubi steps \begin{align*} \text {integral}& = \int \left (a x+b x \sec \left (c+d \sqrt {x}\right )\right ) \, dx \\ & = \frac {a x^2}{2}+b \int x \sec \left (c+d \sqrt {x}\right ) \, dx \\ & = \frac {a x^2}{2}+(2 b) \text {Subst}\left (\int x^3 \sec (c+d x) \, dx,x,\sqrt {x}\right ) \\ & = \frac {a x^2}{2}-\frac {4 i b x^{3/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {(6 b) \text {Subst}\left (\int x^2 \log \left (1-i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d}+\frac {(6 b) \text {Subst}\left (\int x^2 \log \left (1+i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d} \\ & = \frac {a x^2}{2}-\frac {4 i b x^{3/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {6 i b x \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 i b x \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {(12 i b) \text {Subst}\left (\int x \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2}+\frac {(12 i b) \text {Subst}\left (\int x \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2} \\ & = \frac {a x^2}{2}-\frac {4 i b x^{3/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {6 i b x \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 i b x \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {(12 b) \text {Subst}\left (\int \operatorname {PolyLog}\left (3,-i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^3}-\frac {(12 b) \text {Subst}\left (\int \operatorname {PolyLog}\left (3,i e^{i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^3} \\ & = \frac {a x^2}{2}-\frac {4 i b x^{3/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {6 i b x \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 i b x \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {(12 i b) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(3,-i x)}{x} \, dx,x,e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {(12 i b) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(3,i x)}{x} \, dx,x,e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4} \\ & = \frac {a x^2}{2}-\frac {4 i b x^{3/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {6 i b x \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 i b x \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {12 i b \operatorname {PolyLog}\left (4,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {12 i b \operatorname {PolyLog}\left (4,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 223, normalized size of antiderivative = 1.01 \[ \int x \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\frac {a x^2}{2}-\frac {4 i b x^{3/2} \arctan \left (e^{i c+i d \sqrt {x}}\right )}{d}+\frac {6 i b x \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 i b x \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {12 b \sqrt {x} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {12 i b \operatorname {PolyLog}\left (4,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {12 i b \operatorname {PolyLog}\left (4,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4} \]

[In]

Integrate[x*(a + b*Sec[c + d*Sqrt[x]]),x]

[Out]

(a*x^2)/2 - ((4*I)*b*x^(3/2)*ArcTan[E^(I*c + I*d*Sqrt[x])])/d + ((6*I)*b*x*PolyLog[2, (-I)*E^(I*(c + d*Sqrt[x]
))])/d^2 - ((6*I)*b*x*PolyLog[2, I*E^(I*(c + d*Sqrt[x]))])/d^2 - (12*b*Sqrt[x]*PolyLog[3, (-I)*E^(I*(c + d*Sqr
t[x]))])/d^3 + (12*b*Sqrt[x]*PolyLog[3, I*E^(I*(c + d*Sqrt[x]))])/d^3 - ((12*I)*b*PolyLog[4, (-I)*E^(I*(c + d*
Sqrt[x]))])/d^4 + ((12*I)*b*PolyLog[4, I*E^(I*(c + d*Sqrt[x]))])/d^4

Maple [F]

\[\int x \left (a +b \sec \left (c +d \sqrt {x}\right )\right )d x\]

[In]

int(x*(a+b*sec(c+d*x^(1/2))),x)

[Out]

int(x*(a+b*sec(c+d*x^(1/2))),x)

Fricas [F]

\[ \int x \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\int { {\left (b \sec \left (d \sqrt {x} + c\right ) + a\right )} x \,d x } \]

[In]

integrate(x*(a+b*sec(c+d*x^(1/2))),x, algorithm="fricas")

[Out]

integral(b*x*sec(d*sqrt(x) + c) + a*x, x)

Sympy [F]

\[ \int x \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\int x \left (a + b \sec {\left (c + d \sqrt {x} \right )}\right )\, dx \]

[In]

integrate(x*(a+b*sec(c+d*x**(1/2))),x)

[Out]

Integral(x*(a + b*sec(c + d*sqrt(x))), x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 540 vs. \(2 (160) = 320\).

Time = 0.41 (sec) , antiderivative size = 540, normalized size of antiderivative = 2.45 \[ \int x \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\frac {{\left (d \sqrt {x} + c\right )}^{4} a - 4 \, {\left (d \sqrt {x} + c\right )}^{3} a c + 6 \, {\left (d \sqrt {x} + c\right )}^{2} a c^{2} - 4 \, {\left (d \sqrt {x} + c\right )} a c^{3} - 4 \, b c^{3} \log \left (\sec \left (d \sqrt {x} + c\right ) + \tan \left (d \sqrt {x} + c\right )\right ) - 4 \, {\left (i \, {\left (d \sqrt {x} + c\right )}^{3} b - 3 i \, {\left (d \sqrt {x} + c\right )}^{2} b c + 3 i \, {\left (d \sqrt {x} + c\right )} b c^{2}\right )} \arctan \left (\cos \left (d \sqrt {x} + c\right ), \sin \left (d \sqrt {x} + c\right ) + 1\right ) - 4 \, {\left (i \, {\left (d \sqrt {x} + c\right )}^{3} b - 3 i \, {\left (d \sqrt {x} + c\right )}^{2} b c + 3 i \, {\left (d \sqrt {x} + c\right )} b c^{2}\right )} \arctan \left (\cos \left (d \sqrt {x} + c\right ), -\sin \left (d \sqrt {x} + c\right ) + 1\right ) - 12 \, {\left (i \, {\left (d \sqrt {x} + c\right )}^{2} b - 2 i \, {\left (d \sqrt {x} + c\right )} b c + i \, b c^{2}\right )} {\rm Li}_2\left (i \, e^{\left (i \, d \sqrt {x} + i \, c\right )}\right ) - 12 \, {\left (-i \, {\left (d \sqrt {x} + c\right )}^{2} b + 2 i \, {\left (d \sqrt {x} + c\right )} b c - i \, b c^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (i \, d \sqrt {x} + i \, c\right )}\right ) + 2 \, {\left ({\left (d \sqrt {x} + c\right )}^{3} b - 3 \, {\left (d \sqrt {x} + c\right )}^{2} b c + 3 \, {\left (d \sqrt {x} + c\right )} b c^{2}\right )} \log \left (\cos \left (d \sqrt {x} + c\right )^{2} + \sin \left (d \sqrt {x} + c\right )^{2} + 2 \, \sin \left (d \sqrt {x} + c\right ) + 1\right ) - 2 \, {\left ({\left (d \sqrt {x} + c\right )}^{3} b - 3 \, {\left (d \sqrt {x} + c\right )}^{2} b c + 3 \, {\left (d \sqrt {x} + c\right )} b c^{2}\right )} \log \left (\cos \left (d \sqrt {x} + c\right )^{2} + \sin \left (d \sqrt {x} + c\right )^{2} - 2 \, \sin \left (d \sqrt {x} + c\right ) + 1\right ) + 24 i \, b {\rm Li}_{4}(i \, e^{\left (i \, d \sqrt {x} + i \, c\right )}) - 24 i \, b {\rm Li}_{4}(-i \, e^{\left (i \, d \sqrt {x} + i \, c\right )}) + 24 \, {\left ({\left (d \sqrt {x} + c\right )} b - b c\right )} {\rm Li}_{3}(i \, e^{\left (i \, d \sqrt {x} + i \, c\right )}) - 24 \, {\left ({\left (d \sqrt {x} + c\right )} b - b c\right )} {\rm Li}_{3}(-i \, e^{\left (i \, d \sqrt {x} + i \, c\right )})}{2 \, d^{4}} \]

[In]

integrate(x*(a+b*sec(c+d*x^(1/2))),x, algorithm="maxima")

[Out]

1/2*((d*sqrt(x) + c)^4*a - 4*(d*sqrt(x) + c)^3*a*c + 6*(d*sqrt(x) + c)^2*a*c^2 - 4*(d*sqrt(x) + c)*a*c^3 - 4*b
*c^3*log(sec(d*sqrt(x) + c) + tan(d*sqrt(x) + c)) - 4*(I*(d*sqrt(x) + c)^3*b - 3*I*(d*sqrt(x) + c)^2*b*c + 3*I
*(d*sqrt(x) + c)*b*c^2)*arctan2(cos(d*sqrt(x) + c), sin(d*sqrt(x) + c) + 1) - 4*(I*(d*sqrt(x) + c)^3*b - 3*I*(
d*sqrt(x) + c)^2*b*c + 3*I*(d*sqrt(x) + c)*b*c^2)*arctan2(cos(d*sqrt(x) + c), -sin(d*sqrt(x) + c) + 1) - 12*(I
*(d*sqrt(x) + c)^2*b - 2*I*(d*sqrt(x) + c)*b*c + I*b*c^2)*dilog(I*e^(I*d*sqrt(x) + I*c)) - 12*(-I*(d*sqrt(x) +
 c)^2*b + 2*I*(d*sqrt(x) + c)*b*c - I*b*c^2)*dilog(-I*e^(I*d*sqrt(x) + I*c)) + 2*((d*sqrt(x) + c)^3*b - 3*(d*s
qrt(x) + c)^2*b*c + 3*(d*sqrt(x) + c)*b*c^2)*log(cos(d*sqrt(x) + c)^2 + sin(d*sqrt(x) + c)^2 + 2*sin(d*sqrt(x)
 + c) + 1) - 2*((d*sqrt(x) + c)^3*b - 3*(d*sqrt(x) + c)^2*b*c + 3*(d*sqrt(x) + c)*b*c^2)*log(cos(d*sqrt(x) + c
)^2 + sin(d*sqrt(x) + c)^2 - 2*sin(d*sqrt(x) + c) + 1) + 24*I*b*polylog(4, I*e^(I*d*sqrt(x) + I*c)) - 24*I*b*p
olylog(4, -I*e^(I*d*sqrt(x) + I*c)) + 24*((d*sqrt(x) + c)*b - b*c)*polylog(3, I*e^(I*d*sqrt(x) + I*c)) - 24*((
d*sqrt(x) + c)*b - b*c)*polylog(3, -I*e^(I*d*sqrt(x) + I*c)))/d^4

Giac [F]

\[ \int x \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\int { {\left (b \sec \left (d \sqrt {x} + c\right ) + a\right )} x \,d x } \]

[In]

integrate(x*(a+b*sec(c+d*x^(1/2))),x, algorithm="giac")

[Out]

integrate((b*sec(d*sqrt(x) + c) + a)*x, x)

Mupad [F(-1)]

Timed out. \[ \int x \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\int x\,\left (a+\frac {b}{\cos \left (c+d\,\sqrt {x}\right )}\right ) \,d x \]

[In]

int(x*(a + b/cos(c + d*x^(1/2))),x)

[Out]

int(x*(a + b/cos(c + d*x^(1/2))), x)